package com.zsc.yygh.sta.controller;


import com.zsc.yygh.common.result.Result;
import com.zsc.yygh.order.client.OrderFeignClient;
import com.zsc.yygh.vo.order.OrderCountQueryVo;
import com.zsc.yygh.vo.order.OrderQueryVo;
import com.zsc.yygh.vo.order.OrderVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/statistics")
public class StatisticsController {

    @Autowired
    private OrderFeignClient orderFeignClient;

    //获取预约统计数据
    @GetMapping("getCountMap")
    public Result getCountMap(OrderCountQueryVo orderCountQueryVo) {
        Map<String, Object> countMap = orderFeignClient.getCountMap(orderCountQueryVo);
        return Result.ok(countMap);
    }

    @ApiOperation(value = "统计订单状态")
    @GetMapping("getOrder")
    public Result getOrder(OrderCountQueryVo orderCountQueryVo){
        //System.out.println("==========================="+orderFeignClient.getOrder());
        return Result.ok(orderFeignClient.getOrder(orderCountQueryVo));
    }
    @ApiOperation(value = "统计未支付")
    @GetMapping("getOrderPl")
    public Result getOrderPl(OrderCountQueryVo orderCountQueryVo){
        //System.out.println("==========================="+orderFeignClient.getOrder());
        return Result.ok(orderFeignClient.getOrderPl(orderCountQueryVo));
    }

    @ApiOperation(value = "统计已支付")
    @GetMapping("getOrderYPl")
    public Result getOrderYPl(OrderCountQueryVo orderCountQueryVo){
        //System.out.println("==========================="+orderFeignClient.getOrder());
        return Result.ok(orderFeignClient.getOrderYPl(orderCountQueryVo));
    }
}
